import { reqAddress, reqOrder } from "@/api";

export default {
  state: {
    orderInfo: [],
    address: [],
  },
  mutations: {
    UPDATE_ORDERINFO(state, orderInfo) {
      state.orderInfo = orderInfo;
    },
    UPDATE_ADDRESS(state, address) {
      state.address = address;
    },
  },
  actions: {
    async getOrderInfo({ commit }) {
      const res = await reqOrder();
      commit("UPDATE_ORDERINFO", res);
    },
    async getAddress({ commit }) {
      const res = await reqAddress();
      commit("UPDATE_ADDRESS", res);
    },
  },
  getters: {},
};
